package org.fuys.coder.infrastructure.model.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 抽奖活动表
 * @TableName lottery_act
 */
@TableName(value ="lottery_act")
@Data
public class LotteryAct implements Serializable {
    /**
     * 主键 自增
     */
    @TableId(type = IdType.AUTO)
    private Long id;


    /**
     * 活动名称
     */
    private String actName;

    /**
     * 活动描述
     */
    private String actDesc;

    /**
     * 活动封面 对应着文件表id
     */
    private Long actCover;

    /**
     * 每人可以参与的次数
     */
    private Integer takeCount;

    /**
     * 活动状态
     */
    private Integer state;

    /**
     * 开始时间
     */
    private Date beginTime;

    /**
     * 结束时间
     */
    private Date endTime;
    /**
     * 创建者的id
     */
    private Integer creatorId;
    /**
     * 活动抽奖的策略id
     */
    private Integer strategyId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        LotteryAct other = (LotteryAct) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getActName() == null ? other.getActName() == null : this.getActName().equals(other.getActName()))
            && (this.getActDesc() == null ? other.getActDesc() == null : this.getActDesc().equals(other.getActDesc()))
            && (this.getActCover() == null ? other.getActCover() == null : this.getActCover().equals(other.getActCover()))
            && (this.getTakeCount() == null ? other.getTakeCount() == null : this.getTakeCount().equals(other.getTakeCount()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getBeginTime() == null ? other.getBeginTime() == null : this.getBeginTime().equals(other.getBeginTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getActName() == null) ? 0 : getActName().hashCode());
        result = prime * result + ((getActDesc() == null) ? 0 : getActDesc().hashCode());
        result = prime * result + ((getActCover() == null) ? 0 : getActCover().hashCode());
        result = prime * result + ((getTakeCount() == null) ? 0 : getTakeCount().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getBeginTime() == null) ? 0 : getBeginTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", actName=").append(actName);
        sb.append(", actDesc=").append(actDesc);
        sb.append(", actCover=").append(actCover);
        sb.append(", takeCount=").append(takeCount);
        sb.append(", state=").append(state);
        sb.append(", beginTime=").append(beginTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}